package capitulo3;

import java.awt.Polygon;
import java.awt.Rectangle;

// Asteroid class - fovr polygonal asteroid shapes 
public class Asteroid extends BaseVectorShape{
	//define the asteroid polygon shape
	private int[] astX = { -20, -13, 0, 20, 22, 20, 12, 2, -10, -22, -16};
	private int[] astY = { 20, 23, 17, 20, 16, -20, -22, -14, -17, -20, -5};

	// rotation speed
	protected double rotVel;
	public double getRotationVelocity() { return rotVel; }
	public void setRotationVelocity(double v) { this.rotVel =v; }
	
	// Bounding rectangle
	public Rectangle getBounds(){
		Rectangle r;
		r = new Rectangle((int)getX() -20 , (int)getY() -20 , 40, 40);
		return r;
	}
	
	// Default constructor
	Asteroid() {
		setShape(new Polygon(astX,astY,astX.length));
		setAlive(true);
		setRotationVelocity(0.0);
	}
}
